let initState:tokenReducerState = {
    token:localStorage.getItem("token") || null
}
function tokenReducer(state:tokenReducerState=initState,action:tokenAction){
    let newState = {...state};
    switch(action.type){
        case 'SET_TOKEN':
            newState.token = action.token;
            return newState
        default:
            return state;
    }
}

export default tokenReducer;